package com.rank.ccms.util.security;

/*
import com.rank.ccms.util.SecurityUtil;
import com.rank.ccms.util.exception.SecurityViolationException;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.reflect.MethodSignature;
*/

import java.security.Permission;

/**
 * Project: Suggestion List
 * User: Octavian Rusu
 * Date: 06/12/2010
 */
public class AuthorizationCheckerExecutor {

/*
    public Object checkAuthorization(ProceedingJoinPoint pjp) throws Throwable {
        MethodSignature o = (MethodSignature) pjp.getSignature();
        SecurityConstraint sc = o.getMethod().getAnnotation(SecurityConstraint.class);
        if (sc != null) {
            Permission[] permissions = Permissions.getPermissionsByTypes(sc.permissions());
            if (permissions != null) {
                if (SecurityUtil.hasPermissions(permissions)) {
                    return pjp.proceed();
                } else {
                    throw new SecurityViolationException("You have no rights to do this operation.");
                }
            }
        }
        return pjp.proceed();
    }
*/
}
